
@use 'sass:map';
@use 'sass:color';
@use '@angular/material' as mat;


@mixin color($config-or-theme) {
  $config: mat.get-color-config($config-or-theme);
  $background: map.get($config, background);
  $foreground: map.get($config, foreground);
  $primary: map.get($config, primary);
  $accent: map.get($config, accent);

  .mat-option {
    .mat-button {
      .mat-icon {
        margin-right: 0;
      }
    }
  }
}

@mixin density($config-or-theme) {
  // 迁移到 ocap 内
  .mat-autocomplete-panel.ngm-density__compact .mat-optgroup-label {
    @apply text-lg px-4 h-8;
  }

}

@mixin theme($theme) {
  $color: mat.get-color-config($theme);
  $density: mat.get-density-config($theme);
  $typography: mat.get-typography-config($theme);

  @if $color != null {
    @include color($color);
  }
  @if $density != null {
    @include density($density);
  }
  @if $typography != null {
    @include typography($typography);
  }
}
